package com.feiyu.shopsAndgoods.service.impl;

import org.springframework.stereotype.Service;

import java.util.Map;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.feiyu.common.utils.PageUtils;
import com.feiyu.common.utils.Query;

import com.feiyu.shopsAndgoods.dao.CheckShopDao;
import com.feiyu.shopsAndgoods.entity.CheckShopEntity;
import com.feiyu.shopsAndgoods.service.CheckShopService;


@Service("checkShopService")
public class CheckShopServiceImpl extends ServiceImpl<CheckShopDao, CheckShopEntity> implements CheckShopService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<CheckShopEntity> page = this.page(
                new Query<CheckShopEntity>().getPage(params),
                new QueryWrapper<CheckShopEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public PageUtils queryPageByShopId(Map<String, Object> params) {
        QueryWrapper<CheckShopEntity> wrapper = new QueryWrapper<>();
        wrapper.eq("shop_id", params.get("shopId"));
        IPage<CheckShopEntity> page = this.page(
                new Query<CheckShopEntity>().getPage(params),
                wrapper
        );

        return new PageUtils(page);
    }

}